package com.tedu.servies;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.tedu.mapper.ItemMapper;
import com.tedu.pojo.Item;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service  //交给spring来管理
public class ItemServiesImpl implements ItemServies {
    @Autowired
    ItemMapper mapper;


    public List<Item> getItemByPage(int pageNO, int pageSize) {

        Page<Item> page = new Page<Item>(1,pageSize);

        Page<Item> page1 = mapper.selectPage(page, null);

        return page1.getRecords();
    }
}
